home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tch_tpas.zip / PROG9.PAS < prev    next >
Pascal/Delphi Source File  |  1986-04-05  |  640b  |  26 lines

  1. PROGRAM PROG9;
  2. {$U+      Copyright (C), 1985 by Lyle Faurot.  All rights reserved.
  3.  
  4.     New Topics: FOR statement
  5.                 ":n" to specify field width in Write
  6. }
  7.  
  8. VAR
  9.   Low, High, Index  : Integer;
  10.  
  11. BEGIN
  12.     Write('Enter a number (may be negative): ');
  13.     ReadLn(Low);
  14.     Write('Enter a larger number: ');
  15.     ReadLn(High);
  16.     WriteLn;
  17.  
  18.     WriteLn('Ascending');
  19.     FOR Index := Low to High  DO
  20.         WriteLn(Index:10);
  21.  
  22.     WriteLn('Descending');
  23.     FOR Index := High DownTo Low  DO
  24.         WriteLn(Index:6);
  25. END.
  26.